// Queue.h -- interface for a queue
#ifndef QUEUE_H
#define QUEUE_H 0x00

// This queue will contain Customer items
class Customer {
private:
    long arrive;        // arrival time for customer
    int processTime;    // processing time for customer
public:
    Customer() = default;
    void set(long when);
    long when() const { return arrive; }
    int ptime() const { return processTime; }
};

typedef Customer Item;

class Queue {
private:
    // class scope definitions
    // Node is a nested structure definition local to this class
    struct Node {
        Item item;
        struct Node * next;
    };
    enum { Q_SIZE = 10 };
    // private class members
    Node * front;       // pointer to front of Queue
    Node * rear;        // pointer to rear of Queue
    int items;          // current number of items in Queue
    const int qSize;    // maximum number of items in Queue
    // preemptive definitions to prevent public copying
    Queue(const Queue & q) : qSize(0) {}
    Queue & operator=(const Queue & q) { return *this; }
public:
    Queue(int qs = Q_SIZE); // create queue with a qs limit
    ~Queue();
    bool isEmpty() const;
    bool isFull() const;
    int queueCount() const;
    bool enqueue(const Item & item);    // add item to end
    bool dequeue(Item & item);    // remove item from front
};

#endif // QUEUE_H
